{% extends 'base_with_right.html' %}
{% load static blog_extra %}
{% block title %}文章列表{% endblock %}
{% block header_file %}
    <link rel="stylesheet" href="{% static 'css/blog.min.css' %}"/>
{% endblock %}
{% block content %}

    {% if kw %}
        <div class="layui-card bt20">
            <div class="layui-card-body">
                <blockquote class="layui-elem-quote" style="margin-bottom: 0">关键词：{{ kw }}</blockquote>
            </div>
        </div>
    {% endif %}
    <article class="article-list bloglist" id="LAY_bloglist">
        {% for object in object_list %}
            <section class="article-item zoomIn article">
                {% if object.top %}
                    <div class="fc-flag">置顶</div>
                {% endif %}
                <h5 class="title">
                    <span class="fc-blue">【原创】</span>
                    <a target="_blank" href="{{ object.get_absolute_url }}">{{ object.title }}</a>
                </h5>
                <div class="time">
                    <span class="day">{{ object.get_day }}</span>
                    <span class="month fs-18">{{ object.get_month }}<span class="fs-14">月</span></span>
                    <span class="year fs-18 ml10">{{ object.get_year }}</span>
                </div>
                <div class="content">
                    {% if object.thumbnail %}
                        <a target="_blank" href="{{ object.get_absolute_url }}" class="cover img-light">
                            <img src="{{ object.thumbnail }}"/>
                        </a>
                    {% endif %}
                    {{ object.desc }}...
                </div>
                <div class="read-more">
                    <a target="_blank" href="{{ object.get_absolute_url }}" class="fc-black f-fwb">继续阅读</a>
                </div>
                <aside class="f-oh footer">
                    <div class="f-fl tags">
                        <span class="fa fa-tags fs-16"></span>
                        <a class="tag">{{ object.get_category }}</a>
                    </div>
                    <div class="f-fr">
                        <span class="read ml20">
                          <i class="fa fa-thumbs-o-up fs-16"></i>
                          <i class="num">{{ object.up_count }}</i>
                        </span>
                        <span class="read ml20">
                          <i class="fa fa-eye fs-16"></i>
                          <i class="num">{{ object.view_count }}</i>
                        </span>
                        <span class="ml20">
                          <i class="fa fa-comments fs-16"></i>
                          <a target="_blank" href="{{ object.get_absolute_url }}#blog-comment"
                             class="num fc-grey">{{ object.comment_count }}</a>
                        </span>
                    </div>
                </aside>
            </section>
        {% endfor %}
    </article>

    {% if is_paginated %}
        <div class="list-page mt20"
             style="display: flex;align-items: center;justify-content: center">
            {% if page_obj.has_previous %}
                <a href="?page={{ page_obj.previous_page_number }}"
                   class="layui-btn layui-btn-sm layui-btn-normal">上一页</a>
            {% endif %}
            {% if page_obj.has_next %}
                <a href="?page={{ page_obj.next_page_number }}"
                   class="layui-btn layui-btn-sm layui-btn-normal">下一页</a>
            {% endif %}
        </div>
    {% endif %}
{% endblock %}

{% block footer_file %}
    <script src="{% static 'js/article.min.js' %}"></script>
{% endblock %}